/*
 * Copyright (C) 2015  Nicola Spanti (RyDroid) <dev@nicola-spanti.info>
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 * 
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */


#ifndef PLANET_WARS_2D_RT_CORE_MODEL_PLAYER_PLAYING_STRUCT_H
#define PLANET_WARS_2D_RT_CORE_MODEL_PLAYER_PLAYING_STRUCT_H


#include "PlanetWars2dRT-core/specific/model/player_playing_functions.h"
#include "PlanetWars2dRT-core/specific/model/game.h"


struct player_playing
{
  unsigned char index;
  struct game_t* game;
};


static inline
size_t
player_playing_get_nb_planets(const player_playing* player)
{
  return universe_get_nb_planets_of_player_index(&player->game->universe,
						 player->index);
}

static inline
size_t
player_playing_get_nb_ships(const player_playing* player)
{
  return universe_get_nb_ships_of_player_index(&player->game->universe,
					       player->index);
}


#endif
